from connecttodatabase.connect_to_database import E_Manager
from flask import jsonify
from werkzeug.security import generate_password_hash, check_password_hash
from sqlalchemy.exc import SQLAlchemyError

class SCtr_Mana:



    @staticmethod
    def login(manager_id, password):
        manager = E_Manager.get_manager_by_id(manager_id=manager_id)
        if not manager or  manager.get('manager_password')!=password:
            return None
        return 1
   
   
    @staticmethod
    def get_infor(user_id):
        return E_Manager.get_manager_by_id(user_id)
    
    @staticmethod
    def email_id_exist(user_id, email):
        return E_Manager.vetify_email(user_id,email)
    
    
    @staticmethod
    def add_manager(id,password,name,email):
        return E_Manager.add_manager(id,password,name,email)
    
    @staticmethod
    def delete_user(manager_id):
        return E_Manager.delete_manager(manager_id)
    
    @staticmethod
    def get_all_manager():
        return E_Manager.get_manager()